/**
 * Copyright (c) 2021 人人开源 All rights reserved.
 * <p>
 * https://www.mes.io
 * <p>
 * 版权所有，侵权必究！
 */

package com.hmc.modules.pay.controller;

import com.github.xiaoymin.knife4j.annotations.Ignore;
import com.hmc.common.constant.Constant;
import com.hmc.common.page.PageData;
import com.hmc.common.utils.Result;
import com.hmc.modules.pay.dto.AlipayNotifyLogDTO;
import com.hmc.modules.pay.service.AlipayNotifyLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import lombok.AllArgsConstructor;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * 支付宝回调日志
 *
 * @author
 */
@AllArgsConstructor
@RestController
@RequestMapping("pay/alipayNotifyLog")
public class AlipayNotifyLogController {
    private final AlipayNotifyLogService alipayNotifyLogService;

    @GetMapping("page")
    @Operation(summary = "分页")
    @Parameters({
            @Parameter(name = Constant.PAGE, description = "当前页码，从1开始", required = true),
            @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true),
            @Parameter(name = Constant.ORDER_FIELD, description = "排序字段"),
            @Parameter(name = Constant.ORDER, description = "排序方式，可选值(asc、desc)")
    })
    @RequiresPermissions("pay:alipayNotifyLog:all")
    public Result<PageData<AlipayNotifyLogDTO>> page(@Parameter(hidden = true) @RequestParam Map<String, Object> params) {
        PageData<AlipayNotifyLogDTO> page = alipayNotifyLogService.page(params);

        return new Result<PageData<AlipayNotifyLogDTO>>().ok(page);
    }
}